﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using yunbo.Model.IM;
using yunbo.Repositorys.IMRepositorys;

namespace yunbo.Controllers.IMControllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class WMS_PDTZController : ControllerBase
    {
        WMS_PDTZRepository wMS_PDTZRepository = new WMS_PDTZRepository();
        /// <summary>
        /// 添加
        /// </summary>
        /// <returns></returns>
        [HttpPost("PostWMS_PDTZ")]
        public IActionResult PostWMS_CKPD(WMS_PDTZ wMS_PDTZ)
        {
            bool rs = wMS_PDTZRepository.PostWMS_PDTZ(wMS_PDTZ) > 0;
            return Ok(rs);
        }
        /// <summary>
        /// 添加
        /// </summary>
        /// <returns></returns>
        [HttpGet("GetCXWMS_PDTZ")]
        public IActionResult GetCXWMS_PDTZ(int PageNumber, int PageSize)
        {
            FYCXWMS_PDTZ fYCXWMS = wMS_PDTZRepository.GetCXWMS_PDTZ(PageNumber, PageSize);
            return Ok(fYCXWMS);
        }
        /// <summary>
        /// 修改状态
        /// </summary>
        /// <returns></returns>
        [HttpPut("UpdateCXWMS_PDTZ")]
        public IActionResult UpdateCXWMS_PDTZ(string code)
        {
            bool rs = wMS_PDTZRepository.UpdateCXWMS_PDTZ(code) >0;
            return Ok(rs);
        }
        /// <summary>
        /// 驳回
        /// </summary>
        /// <returns></returns>
        [HttpPut("UpdateCXWMS_PDTZBH")]
        public IActionResult UpdateCXWMS_PDTZBH(string code,string bhyy)
        {
            bool rs = wMS_PDTZRepository.UpdateCXWMS_PDTZBH(code,bhyy) > 0;
            return Ok(rs);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <returns></returns>
        [HttpDelete("DeleteCXWMS_PDTZ")]
        public IActionResult DeleteCXWMS_PDTZ(string code)
        {
            bool rs = wMS_PDTZRepository.DeleteCXWMS_PDTZ(code) > 0;
            return Ok(rs);
        }
    }
}
